﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ParsingProject
{
    class Program
    {
        static void Main(string[] args)
        {
            ConvertToJSON(new LengthFixedParser(new TabBasedParser(), 15, 1, false),
                args[0], args[1]);
        }

        public static void ConvertToCSV(IParser parser, string inPath, string outPath)
        {
            var result = parser.Parse(inPath);
            FileFactory.WriteAsCSV(outPath, result);
            Console.WriteLine(outPath + " has been successfully converted!");
        }

        public static void ConvertToJSON(IParser parser, string inPath, string outPath)
        {
            var result = parser.Parse(inPath);
            FileFactory.WriteAsJSON(outPath, result, 1000, true);
            Console.WriteLine(outPath + " has been successfully converted!");
        }
    }
}
